<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<title>module Visual - RDoc Documentation</title>

<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
</script>

<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>


<body id="top" class="module">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="./index.html">Home</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  <div id="file-metadata">
    <nav id="file-list-section" class="section">
  <h3 class="section-header">Defined In</h3>
  <ul>
    <li>lib/visual.rb
  </ul>
</nav>

    
  </div>

  <div id="class-metadata">
    
    
    
    <!-- Method Quickref -->
<nav id="method-list-section" class="section">
  <h3 class="section-header">Methods</h3>

  <ul class="link-list">
    
    <li><a href="#method-i-to_pdf">#to_pdf</a>
    
  </ul>
</nav>

  </div>

  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="./Gemfile.html">Gemfile</a>
  
    <li class="file"><a href="./README_rdoc.html">README</a>
  
    <li class="file"><a href="./syc_barcode/Gemfile.html">Gemfile</a>
  
    <li class="file"><a href="./syc_barcode/MIT-LICENSE.html">MIT-LICENSE</a>
  
    <li class="file"><a href="./syc_barcode/README_rdoc.html">README</a>
  
    <li class="file"><a href="./syc_barcode/Rakefile.html">Rakefile</a>
  
    <li class="file"><a href="./syc_barcode/test/dummy/README_rdoc.html">README</a>
  
    <li class="file"><a href="./syc_barcode/test/dummy/Rakefile.html">Rakefile</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="./CheckedAttributes.html">CheckedAttributes</a>
  
    <li><a href="./CheckedAttributes/ClassMethods.html">CheckedAttributes::ClassMethods</a>
  
    <li><a href="./Dummy.html">Dummy</a>
  
    <li><a href="./Dummy/Application.html">Dummy::Application</a>
  
    <li><a href="./ApplicationController.html">ApplicationController</a>
  
    <li><a href="./ApplicationHelper.html">ApplicationHelper</a>
  
    <li><a href="./Barcode.html">Barcode</a>
  
    <li><a href="./Interleave2of5.html">Interleave2of5</a>
  
    <li><a href="./Object.html">Object</a>
  
    <li><a href="./SycBarcode.html">SycBarcode</a>
  
    <li><a href="./SycBarcodeTest.html">SycBarcodeTest</a>
  
    <li><a href="./Visual.html">Visual</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation">
  <h1 class="module">module Visual</h1>

  <div id="description" class="description">
    
<p>Methods to visualize a barcode</p>

  </div><!-- description -->

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    

    

    <!-- Methods -->
    
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Instance Methods</h3>

    
      <div id="method-i-to_pdf" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">to_pdf</span><span
            class="method-args">(pdf, options={})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Adds a barcode to a pdf file</p>
          

          
          <div class="method-source-code" id="to_pdf-source">
            <pre><span class="ruby-comment"># File lib/visual.rb, line 7</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_pdf</span>(<span class="ruby-identifier">pdf</span>, <span class="ruby-identifier">options</span>={})
  <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">undash</span>
  <span class="ruby-identifier">barcode</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:bars</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">b</span>[<span class="ruby-value">:x</span>],             <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">b</span>[<span class="ruby-value">:x</span>],             <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:height</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">b</span>[<span class="ruby-value">:x</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">b</span>[<span class="ruby-value">:width</span>], <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:height</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">b</span>[<span class="ruby-value">:x</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">b</span>[<span class="ruby-value">:width</span>], <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">b</span>[<span class="ruby-value">:x</span>],             <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">fill</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:bearer</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:frame</span>
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:x</span>], <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:x</span>], 
                <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:height</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:x</span>] <span class="ruby-operator">+</span> <span class="ruby-value">2</span> * <span class="ruby-ivar">@options</span>[<span class="ruby-value">:quiet</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:graph_width</span>],
                <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:height</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:x</span>] <span class="ruby-operator">+</span> <span class="ruby-value">2</span> * <span class="ruby-ivar">@options</span>[<span class="ruby-value">:quiet</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:graph_width</span>],
                <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>]) 
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:x</span>],
                <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:y</span>])
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:bearer</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:rule</span>
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:x</span>], 
                <span class="ruby-ivar">@options</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:bottom_margin</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:height</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:x</span>] <span class="ruby-operator">+</span> <span class="ruby-value">2</span> * <span class="ruby-ivar">@options</span>[<span class="ruby-value">:quiet</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:graph_width</span>],
                <span class="ruby-ivar">@options</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:bottom_margin</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:height</span>])
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:x</span>] <span class="ruby-operator">+</span> <span class="ruby-value">2</span> * <span class="ruby-ivar">@options</span>[<span class="ruby-value">:quiet</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph</span>[<span class="ruby-value">:graph_width</span>],
                <span class="ruby-ivar">@options</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:bottom_margin</span>]) 
    <span class="ruby-identifier">pdf</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:x</span>],
                <span class="ruby-ivar">@options</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:bottom_margin</span>])
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@graph</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- to_pdf-source -->
          
        </div>

        

        
      </div><!-- to_pdf-method -->

    
    </section><!-- public-instance-method-details -->
  
  </section><!-- 5Buntitled-5D -->

</div><!-- documentation -->


<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.2.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>

